<div ng-controller="ServReqPayCtrl" ng-init="init()">
    <div class="bg-light lter b-b wrapper-md">
        <span class="m-n font-thin h3">
        	<span class="font-bold">{{'common.application' | translate}}
            <span>{{'servicetype.servicetype_' + servReq._servType.service_Id | translate}} - </span></span>
            <span class="font-bold" translate="business.servreq.pay"></span>
            <!--<b translate="common.application"></b>-->
            <!--<b translate="{{'servicetype.servicetype_' + servReq._servType.service_Id}}"></b>-->
            <!--<b> - </b>-->
            <!--<b translate="business.servreq.pay"></b>-->
        </span>
        <span class="pull-right">
            <a class="btn btn-primary" ui-sref="app.process.service({service_Id:servReq._servType.service_Id})">
                <span translate="common.backList"></span>
            </a>
        </span>
    </div>

    <form method="post">
        <div ng-class="isSmart?'':'wrapper-md'" class="remove-wrapper">
            <div class="panel panel-default">
                <div class="process-pay-margin">
                    <div class="panel-heading hidden-xs">
                        <span><img src="images/logo11.4.gif" width="140px" height="55px"/></span>
                        <span class="pull-right font-bold process-pay-text" translate="business.servreq.pay"></span>
                    </div>
                    <div class="panel-body">
                        <h3 class="text-center font-bold">
                            <span>{{'servicetype.servicetype_' + servReq._servType.service_Id | translate}}</span>
                            <span> - </span>
                            <span translate="dashboard.paidamount"></span>
                        </h3>

                        <div class="row row-style" style="padding:34px 0 0">
                            <div class="col-sm-3 font-bold"><span translate="common.name"></span>:
                                {{servReq._patCase._patient._user.realName}}
                            </div>
                            <div class="col-sm-3 font-bold"><span translate="business.servreq.id"></span>:
                                S-{{servReq.servReq_Id}}
                            </div>
                            <div class="col-sm-3 font-bold"><span translate="common.payAmount"></span>:
                                {{servReq._servType.service_Fee | currency: '￥'}}
                            </div>
                        </div>
                        <div class="font-bold process-pay-footer" style="padding-bottom: 0px"><span
                                translate="business.servreq.payments"></span>：
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <img style="cursor: pointer" src="images/wechat.png" height="120px;"
                                     ng-click="open({ templateUrl:'wechatPay.html' }, servReq)"/>
                            </div>
                            <div class="col-md-6">
                                <img style="cursor: pointer" src="images/alipay.png" height="120px;"
                                     ng-click="open({ templateUrl:'aliPay.html' }, servReq)"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<!--Wechat Modal-->
<script type="text/ng-template" id="wechatPay.html">
    <div class="modal-content" ng-init="init('Wechat')">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><span
                    class="sr-only">Close</span></button>
            <h4 class="modal-title">
                <span translate="business.servreq.monetary"></span>
                <button type="button" class="close" ng-click="cancel()"><span class="icon icon-close"
                                                                              aria-hidden="true"></span></button>

            </h4>
        </div>
        <div class="modal-body" style="height:425px;">
            <h5><span translate="business.servreq.please_pay"></span>：{{servReq._servType.service_Fee}}RMB</h5>

            <div style="text-align: center;">
                <img ng-src="./images/loading.gif" ng-if="wechatPayUrl==''"
                     style="position:absolute;left:50%;margin-left:-50px;top:50%;margin-top:-50px;">
                <img id="qr_Wechat" style="max-width:360px;max-height:360px;" ng-src="{{wechatPayUrl}}"
                     ng-if="wechatPayUrl!=''"/>
            </div>
        </div>
        <div class="modal-footer">
            <span class="pull-left" ng-click="setPaid()" style="cursor: pointer;user-select: none;" ng-if="canSetPaid"
                  translate="business.servreq.paysuccessful"></span>
            <button type="button" class="btn btn-default" ng-click="refreshQr()" ng-if="canReloadQr"
                    translate="business.servreq.reloadqr">
            </button>
            <button type="button" class="btn btn-default" ng-click="ok()" ng-if="canGo"
                    translate="common.backList"></button>
            <button type="button" class="btn btn-default" ng-click="cancel()" ng-if="canClose"
                    translate="common.close"></button>
        </div>
    </div>
</script>
<!--Alipay Modal-->
<script type="text/ng-template" id="aliPay.html">
    <div class="modal-content" ng-init="init('Alipay')">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><span
                    class="sr-only">Close</span></button>
            <h4 class="modal-title">
                <span translate="business.servreq.newpage"></span>
                <button type="button" class="close" ng-click="cancel()"><span class="icon icon-close"
                                                                              aria-hidden="true"></span></button>
            </h4>
        </div>
        <div class="modal-body" style="height:425px;">
            <h5><span translate="business.servreq.please_pay"></span>：{{servReq._servType.service_Fee}}RMB</h5>

            <div style="text-align: center;">
                <h2 style="text-align: center;line-height: 320px;" ng-if="wechatPayUrl==''"><b
                        translate="business.servreq.waitpay"></b></h2>
                <img style="width:360px;height:360px;" ng-src="{{wechatPayUrl}}" ng-if="wechatPayUrl!=''"/>
            </div>
        </div>
        <div class="modal-footer">
            <span class="pull-left" ng-click="setPaid()" style="cursor: pointer;user-select: none;"
                  translate="business.servreq.paysuccessful"></span>
            <button type="button" class="btn btn-default" ng-click="ok()" ng-if="canGo"
                    translate="common.backList"></button>
            <button type="button" class="btn btn-default" ng-click="cancel()" ng-if="canClose"
                    translate="common.close"></button>
        </div>
    </div>
</script>